import Vue from "vue";

/**
 * 根据对象路径获取对象值
 * @param {*} obj
 * @param {*} path
 * @returns
 */
export function getValueByPath(obj, path) {
  let paths = path.split(".");
  let res = obj;
  let prop;
  while ((prop = paths.shift())) {
    res = res[prop];
  }
  return res;
}
